package cn.lg.soar.cloud.core.feign;

import cn.lg.soar.cloud.core.feign.fallback.OperationLogApiFallbackFactory;
import cn.lg.soar.common.model.LogDTO;
import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.core.handler.log.IOperationLogSaveService;
import cn.lg.soar.system.api.constant.ModuleConst;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Collection;

/**
 * @author luguoxiang
 * @date 2021-08-11
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ConditionalOnMissingClass("cn.lg.soar.system.biz.modules.monitor.client.OperationLogApiClient")
@ApiClient
@FeignClient(name= ModuleConst.MODULE_NAME, path= ModuleConst.CLIENT_PATH + "/log", contextId="OperationLogApiFeign"
        , fallbackFactory= OperationLogApiFallbackFactory.class)
public interface OperationLogApiFeign extends IOperationLogSaveService {

    @PostMapping("saveLog")
    @Override
    void saveLog(@RequestBody Collection<? extends LogDTO> logs);

}
